﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Mbl.ParameterizedTest.AcceptanceTests.CalculatorTests;

namespace Mbl.ParameterizedTest.AcceptanceTests.StringTests
{
    [TestClass]
    public class EqualityTests
    {
        [TestMethod]
        [ExpectedFailedTestCases(2, 3, 4)]
        public void Equals_tests()
        {            
            ParameterizedTest
                .For<string>(s => s)
                .Given("asdf").Expect("asdf").Because("It's right")
                .Given("asdf").Expect("asd").Because("It's wrong")
                .Given("asdf").ExpectContains("x").Because("It's wrong")
                .Given("asdf").ExpectContains("ASDF").Because("It's wrong")
                .Evaluate();
        }

        [TestMethod]
        [ExpectedFailedTestCases(3, 6)]
        public void EqualsIgnoreCase_tests()
        {
            ParameterizedTest
                .For<string>(s => s)
                .Given("asdf").ExpectIgnoringCase("asdf").Because("It's right")
                .Given("asdf").ExpectIgnoringCase("ASDF").Because("It's right")
                .Given("asdf").ExpectIgnoringCase("xxxx").Because("It's wrong")
                .Given("asdf").ExpectI("asdf").Because("It's right")
                .Given("asdf").ExpectI("ASDF").Because("It's right")
                .Given("asdf").ExpectI("xxxx").Because("It's wrong")
                .Evaluate();
        }

        [TestMethod]
        [ExpectedFailedTestCases(2, 3)]
        public void Null_tests()
        {
            ParameterizedTest
                .For<string>(s => s)
                .Given(null).ExpectNull().Because("It's right")                
                .Given("asdf").ExpectNull().Because("It's wrong")
                .Given(string.Empty).ExpectNull().Because("It's wrong")
                .Evaluate();
        }
    }
}
